<?php

namespace App\Model;

use App\Model\ShopAttrValModel;
use Illuminate\Database\Eloquent\Model;

class UserEnergyLog extends Model
{
     //定义一个表名
    protected $table = 'user_energy_log';
    //定义主键
	protected $guarded = [];
    protected $primaryKey = 'id';

    public static function add_log($uid,$num=0,$sign='+',$type=1,$status=1,$remark='',$tid=0,$wid=0,$red_one=0,$red_two=0,$blue_one=0,$blue_two=0){
		UserEnergyLog::create([
			'uid' => $uid,
			'num' => $num,
			'sign' => $sign,
			'type' => $type,
			'status' => $status,
			'tid' => $tid,
			'remark' => $remark,
			'wid' => $wid,
			'red_one' => $red_one,
			'red_two' => $red_two,
			'blue_one' => $blue_one,
			'blue_two' => $blue_two,
			'date' => date('m-d'),
		]);
	}
}